# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.SearchAds360.V0.Model.GoogleAdsSearchads360V0Resources_ConversionAction do
  @moduledoc """
  A conversion action.

  ## Attributes

  *   `appId` (*type:* `String.t`, *default:* `nil`) - App ID for an app conversion action.
  *   `attributionModelSettings` (*type:* `GoogleApi.SearchAds360.V0.Model.GoogleAdsSearchads360V0Resources_ConversionAction_AttributionModelSettings.t`, *default:* `nil`) - Settings related to this conversion action's attribution model.
  *   `category` (*type:* `String.t`, *default:* `nil`) - The category of conversions reported for this conversion action.
  *   `clickThroughLookbackWindowDays` (*type:* `String.t`, *default:* `nil`) - The maximum number of days that may elapse between an interaction (for example, a click) and a conversion event.
  *   `creationTime` (*type:* `String.t`, *default:* `nil`) - Output only. Timestamp of the Floodlight activity's creation, formatted in ISO 8601.
  *   `floodlightSettings` (*type:* `GoogleApi.SearchAds360.V0.Model.GoogleAdsSearchads360V0Resources_ConversionAction_FloodlightSettings.t`, *default:* `nil`) - Output only. Floodlight settings for Floodlight conversion types.
  *   `id` (*type:* `String.t`, *default:* `nil`) - Output only. The ID of the conversion action.
  *   `includeInClientAccountConversionsMetric` (*type:* `boolean()`, *default:* `nil`) - Whether this conversion action should be included in the "client_account_conversions" metric.
  *   `includeInConversionsMetric` (*type:* `boolean()`, *default:* `nil`) - Output only. Whether this conversion action should be included in the "conversions" metric.
  *   `name` (*type:* `String.t`, *default:* `nil`) - The name of the conversion action. This field is required and should not be empty when creating new conversion actions.
  *   `ownerCustomer` (*type:* `String.t`, *default:* `nil`) - Output only. The resource name of the conversion action owner customer, or null if this is a system-defined conversion action.
  *   `primaryForGoal` (*type:* `boolean()`, *default:* `nil`) - If a conversion action's primary_for_goal bit is false, the conversion action is non-biddable for all campaigns regardless of their customer conversion goal or campaign conversion goal. However, custom conversion goals do not respect primary_for_goal, so if a campaign has a custom conversion goal configured with a primary_for_goal = false conversion action, that conversion action is still biddable. By default, primary_for_goal will be true if not set. In V9, primary_for_goal can only be set to false after creation through an 'update' operation because it's not declared as optional.
  *   `resourceName` (*type:* `String.t`, *default:* `nil`) - Immutable. The resource name of the conversion action. Conversion action resource names have the form: `customers/{customer_id}/conversionActions/{conversion_action_id}`
  *   `status` (*type:* `String.t`, *default:* `nil`) - The status of this conversion action for conversion event accrual.
  *   `type` (*type:* `String.t`, *default:* `nil`) - Immutable. The type of this conversion action.
  *   `valueSettings` (*type:* `GoogleApi.SearchAds360.V0.Model.GoogleAdsSearchads360V0Resources_ConversionAction_ValueSettings.t`, *default:* `nil`) - Settings related to the value for conversion events associated with this conversion action.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :appId => String.t() | nil,
          :attributionModelSettings =>
            GoogleApi.SearchAds360.V0.Model.GoogleAdsSearchads360V0Resources_ConversionAction_AttributionModelSettings.t()
            | nil,
          :category => String.t() | nil,
          :clickThroughLookbackWindowDays => String.t() | nil,
          :creationTime => String.t() | nil,
          :floodlightSettings =>
            GoogleApi.SearchAds360.V0.Model.GoogleAdsSearchads360V0Resources_ConversionAction_FloodlightSettings.t()
            | nil,
          :id => String.t() | nil,
          :includeInClientAccountConversionsMetric => boolean() | nil,
          :includeInConversionsMetric => boolean() | nil,
          :name => String.t() | nil,
          :ownerCustomer => String.t() | nil,
          :primaryForGoal => boolean() | nil,
          :resourceName => String.t() | nil,
          :status => String.t() | nil,
          :type => String.t() | nil,
          :valueSettings =>
            GoogleApi.SearchAds360.V0.Model.GoogleAdsSearchads360V0Resources_ConversionAction_ValueSettings.t()
            | nil
        }

  field(:appId)

  field(:attributionModelSettings,
    as:
      GoogleApi.SearchAds360.V0.Model.GoogleAdsSearchads360V0Resources_ConversionAction_AttributionModelSettings
  )

  field(:category)
  field(:clickThroughLookbackWindowDays)
  field(:creationTime)

  field(:floodlightSettings,
    as:
      GoogleApi.SearchAds360.V0.Model.GoogleAdsSearchads360V0Resources_ConversionAction_FloodlightSettings
  )

  field(:id)
  field(:includeInClientAccountConversionsMetric)
  field(:includeInConversionsMetric)
  field(:name)
  field(:ownerCustomer)
  field(:primaryForGoal)
  field(:resourceName)
  field(:status)
  field(:type)

  field(:valueSettings,
    as:
      GoogleApi.SearchAds360.V0.Model.GoogleAdsSearchads360V0Resources_ConversionAction_ValueSettings
  )
end

defimpl Poison.Decoder,
  for: GoogleApi.SearchAds360.V0.Model.GoogleAdsSearchads360V0Resources_ConversionAction do
  def decode(value, options) do
    GoogleApi.SearchAds360.V0.Model.GoogleAdsSearchads360V0Resources_ConversionAction.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for: GoogleApi.SearchAds360.V0.Model.GoogleAdsSearchads360V0Resources_ConversionAction do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
